TensorFlow 1.x Deep Learning Cookbook by Antonio Gulli

TensorFlow 1.x Deep Learning Cookbook by Antonio Gulli

Author:Antonio Gulli
Language: eng
Format: epub
Tags: COM018000 - COMPUTERS / Data Processing, COM004000 - COMPUTERS / Intelligence (AI) and Semantics, COM044000 - COMPUTERS / Neural Networks
Publisher: Packt
Published: 2017-12-12T05:56:38+00:00


maxlen = 25

char_idx = None

if os.path.isfile(char_idx_file):

print('Loading previous char_idx')

char_idx = pickle.load(open(char_idx_file, 'rb'))

X, Y, char_idx = \

textfile_to_semi_redundant_sequences(path, seq_maxlen=maxlen, redun_step=3,

pre_defined_char_idx=char_idx)

pickle.dump(char_idx, open(char_idx_file,'wb'))

Define an RNN made up of three LSTMs, each of which has 512 nodes and returns the full sequence instead of the last sequence output only. Note that we use drop-out modules with a probability of 50% for connecting the LSTM modules. The last layer is a dense layer applying a softmax with length equal to the dictionary size. The loss function is categorical_crossentropy and the optimizer is Adam:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.